﻿<UserControl x:Class="Main.Views.OptionsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:viewModels="clr-namespace:Main.ViewModels"
    xmlns:t="clr-namespace:Infrastructure.Theming;assembly=Infrastructure.Client"
    xmlns:regions="http://www.codeplex.com/prism"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:views="clr-namespace:Main.Views"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400"
    d:DataContext="{d:DesignInstance d:Type=viewModels:OptionsViewModel}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Infrastructure.Client;component/Assets/Themes/DefaultTheme.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border Grid.ColumnSpan="2" t:Theme.Style="{StaticResource TitleBorder}">
            <TextBlock Text="{Binding Title}" t:Theme.Style="{StaticResource TitleText}" />
        </Border>
        <toolkit:Expander Grid.Row="1" Margin="10" Header="{Binding Title}" IsExpanded="True">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <TextBlock Text="{Binding LabelLanguageSelection}" />
                <views:LanguageSelectionView Grid.Column="1"  DataContext="{Binding LanguageSelection}" />
                <TextBlock Grid.Row="1" Text="{Binding LabelThemeSelection}"/>
                <views:ThemeSelectionView Grid.Column="1" Grid.Row="1" DataContext="{Binding ThemeSelection}" />
                <TextBlock Grid.Row="2" Text="{Binding LabelNotificationUrl}"/>
                <Grid Grid.Row="2" Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <TextBox Text="{Binding NotificationUrl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.ColumnSpan="2" Margin="10" />
                    <Button Grid.Row="1" Content="{Binding LabelTestConnection}" Command="{Binding TestNotificationCommand}" CommandParameter="{Binding}" Margin="10" />
                    <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding TestConnectionReturn}" VerticalAlignment="Center" />
                </Grid>
                <TextBlock Grid.Row="3" Text="{Binding LabelAppInfo}"/>
                <views:AppInfoView Grid.Row="3" Grid.Column="1" DataContext="{Binding AppInfo}"/>
            </Grid>
        </toolkit:Expander>
        <ItemsControl Grid.Row="2" regions:RegionManager.RegionName="Options" Margin="10"/>
    </Grid>
</UserControl>
